﻿using System;
using System.ComponentModel;

namespace Meliose.Core
{
    public interface INotifyPropertyChangedEx : INotifyPropertyChanged
    {
        event PropertyChangedExEventHandler PropertyChangedEx;
    }

    public delegate void PropertyChangedExEventHandler(object sender, PropertyChangedExEventArgs e);
    public class PropertyChangedExEventArgs : PropertyChangedEventArgs
    {
        private object _oldValue;
        public object OldValue { get { return _oldValue; } protected set { _oldValue = value; } }

        private object _newValue;
        public object NewValue { get { return _newValue; } protected set { _newValue = value; } }

        public PropertyChangedExEventArgs(string propertyName, object oldValue, object newValue)
            : base(propertyName)
        {
            OldValue = oldValue;
            NewValue = newValue;
        }
    }
}
